#include "reg52.h"

#define LED_DROP P1
sbit KEY2_DROP=P3^4;
sbit KEY3_DROP=P3^5;
sbit BEEP_DROP=P2^3;

void delay(unsigned int i)
{
	while(i--);
}

void main()
{
	while(1)
	{
		if(KEY2_DROP==0)
		{
			delay(2000);
			if(KEY2_DROP==0)
			{
				LED_DROP = 0x01;
			}
			while(KEY2_DROP==0);
			LED_DROP = 0xfe;
		}
		
		if(KEY3_DROP==0)
		{
			delay(2000);
			if(KEY3_DROP==0)
			{
				while(KEY3_DROP==0)
				{
					BEEP_DROP = !BEEP_DROP;
					delay(20);
				}
				if(KEY3_DROP==1)
					BEEP_DROP = 1;
			}
			while(KEY3_DROP==0);
			LED_DROP = 0xfc;
		}
	}
}